<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
		<script src="connectUtils-1-4-8.js" type="text/javascript"></script>
		<script src="admin.js" type="text/javascript"></script>
		<link rel="stylesheet" type="text/css" href="//aui-cdn.atlassian.com/aui-adg/6.0.4/css/aui.css">
	</head>
	<body class="aui-layout aui-theme-default" style="background-color:rgb(255, 255, 255);">
		<div class="aui-page-panel" style="margin-top:0px;">
			<h4 style="padding-top:20px;" data-i18n="gliffyImport">Gliffy Import</h4>
			<div><br><span data-i18n="gliffyImportInst1">Click the "Start Import" button to import all Gliffy diagrams to draw.io.</span><br>
			<span data-i18n="gliffyImportInst2">Please note that the import procedure will take some time and the browser window must remain open until the import is completed.</span></div>
			<div style="padding-bottom:4px;"><br><button id="importBtn" disabled="disabled" class="aui-button aui-button-primary" data-i18n="startImport">Start Import</button></div>
			<div id="operationLog"><br></div>
		</div>
		<script type="text/javascript">
			//Logs uncaught errors
			window.onerror = function(message, url, linenumber, colno, err)
			{
				message = 'Confluence Cloud Admin: ' + ((message != null) ? message : '');
				
				AC.logError(message, url, linenumber, colno, err);
			};
			
			var baseUrl = AC.getBaseUrl();
	
			var script = document.createElement('script');
	
			script.onload = function()
			{
				AP.sizeToParent(true);
				
				setTimeout(function()
				{
					AP.sizeToParent(true);
				}, 5000); //Try resizing again after 5 sec since the first one fails sometimes
				
				getAndApplyTranslation(function()
				{
					//JQuery is loaded in this page, so we can use it
					var logDiv = $('#operationLog');
	
					var importBtn = $('#importBtn');
					
					importBtn.attr("disabled", null);
					
					importBtn.click(function()
					{
						GliffyMassImporter(logDiv);
					});
				});
			};
	
			script.src = 'https://connect-cdn.atl-paas.net/all.js';
			script.setAttribute('data-options', 'resize:false;margin:false');
			document.getElementsByTagName('head')[0].appendChild(script);
		</script>
	</body>
</html>
